home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Shareware Plus / Developers / Flame / ReadMe < prev   
Encoding:
Text File  |  1996-11-20  |  3.8 KB  |  139 lines  |  [TEXT/R*ch]

  1. Flame - 0.9
  2. by Kyle Ellrott
  3. garage@wave.net
  4. -----
  5. This is a very simple set of subprograms that will allow you to create flame 
  6. effects.  What more can I say, it lets you burn things.
  7.  
  8. --
  9. There are some simple functions that you should know if you want to 
  10. use this library.
  11.  
  12. --
  13. OSErr SetUpFlames(CTabHandle flamePalette, CTabHandle destPalette,
  14.                     Rect *bounds, char speed, FlamePtr *theFlame);
  15.     
  16. You call this to set up your new flame.  
  17.  
  18. flamePalette - This is the values that the flame goes through as it goes 
  19. through each value.  You should start with the ash color, which is also 
  20. the clear color, for the MaskFlame function.  As the values acsend, so should 
  21. your colors.  The last color, number 255 should be the color of hottest flame.
  22.                 
  23. destPalette - This is the pallete for where you plan to draw the flame.  The 
  24. destination must be an 8-bit pixmap.
  25.  
  26. bounds - The size of the destination.  
  27.  
  28. speed - This is the allows you to speed up the flames, if you want to.
  29. The different speed ups are: noSpeedUp, lowRes2, and lowRes4.
  30. lowRes2 & lowRes4 simply increase the size of the pixels in the flames.
  31. This doesn't hurt the quality of the image that much, but anything that you
  32. throw in the fire is also increased in size.
  33.  
  34. theFlame - This is the data structure that you will be altering later on.
  35.  
  36.  
  37. --
  38. void KillFlames(FlamePtr *theFlame);
  39.  
  40. Call this to dispose of the memory taken up by theFlame.
  41.  
  42.  
  43. --
  44. void ChuckInFire(short x, short y, PixMapPtr victim, FlamePtr theFlame);
  45.  
  46. You can throw somebody that you don't like into the flames, and then watch
  47. them burn.
  48.  
  49. x , y - The location of where the top lefthand corner of the victim should go.
  50.  
  51. victim - The source image.  This must be a 8-bit pixmap.
  52.  
  53. theFlame - The firey inferno you wish to throw your victim into.
  54.  
  55.  
  56. --
  57. void Spark(short x, short y, unsigned char heat, FlamePtr theFlame);
  58.  
  59. Draw a dot of light in the blaze.  You can use this do draw custom designs 
  60. into the flame.
  61.  
  62. x , y - The location
  63.  
  64. heat - The value of the pixel.
  65.  
  66. theFlame - The fire that you are drawing into.
  67.  
  68.  
  69. --
  70. void SetUpBurn(unsigned char odds, unsigned char max, 
  71.             unsigned char min, FlamePtr theFlame);
  72.  
  73. This draws several pixels at the bottom of the fire place, giving you a fire source.
  74.  
  75. odds - How often will it happen, out of 255.
  76.  
  77. max - The maximum length of a 'log'.
  78.  
  79. min - The minimum length of a 'log'.  Note: I didn't do much error checking, so 
  80. min better be less then max.
  81.  
  82. theFlame - The fire that you are helping to burn.
  83.  
  84.  
  85. --
  86. void Burn (FlamePtr theFlame, unsigned char takeOff, Boolean fuzz);
  87.  
  88. This is the heart of the program.  It is the sub-program that actually 
  89. burns things.
  90.  
  91. theFlame - The fire that is burning.
  92.  
  93. takeOff - How much should the flame diminish as it travels upward.
  94.  
  95. fuzz - If you pass a true, it will randomly variate the takeOff value.
  96. I put it in to get rid of the plazma look, and give it more of a camp
  97. fire look, but it doesn't help much.  I plan to get rid of it in favor 
  98. of other possible variations.
  99.  
  100.  
  101. --
  102. void CopyFlame(short x, short y, FlamePtr theFlame, PixMapPtr dest);
  103.  
  104. This draws the flame directly into the destination.
  105.  
  106. x , y - The dest location
  107.  
  108. theFlame - The fire that you are drawing.
  109.  
  110. dest - The pixmap that you are drawing to.  This must be an 8-bit pixmap.
  111.  
  112.  
  113. --
  114. void MaskFlame(short x, short y, FlamePtr theFlame, PixMapPtr dest);
  115.  
  116. Same thing as CopyFlame, but it doesn't draw the clear color.
  117.  
  118.  
  119. --
  120. Plans for the future:
  121.  
  122.  - Work in other other color types then just 8-bit indexed
  123.  - A sin wave variation on the flame path
  124.  - Some assembly to speed up key parts
  125.  - Just make it faster
  126.  - Burn down a building
  127.  
  128. --
  129. Legal junk
  130. I coded this as a practice, and also because I like to burn things.
  131. All I really want is a nice mention in any program that you use this 
  132. in, and maybe a nice e-mail, that I can burn.
  133.  
  134. Kyle Ellrott
  135. garage@wave.net
  136.  
  137. 'Fire!! Fire!!  Ehh, Ehh'
  138. Beavis and Butthead
  139.